package com.dsmclub.myfootballds;

import android.os.Bundle;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.view.Menu;
import android.widget.TabHost;

public class MainActivity extends TabActivity {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        
        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        // Initialize a TabSpec for each tab and add it to the TabHost
        
        intent = new Intent().setClass(this, TodayTabActivity.class);
        spec = tabHost.newTabSpec("today").setIndicator("Today",res.getDrawable(R.drawable.icon32_32)).setContent(intent);
        tabHost.addTab(spec);
        
        intent = new Intent().setClass(this, NextTourTabActivity.class);
        spec = tabHost.newTabSpec("nexttour").setIndicator("Next Tour", res.getDrawable(R.drawable.icon48_48)).setContent(intent);
        tabHost.addTab(spec);
        
        intent = new Intent().setClass(this, ScoreTableTabActivity.class);
        spec = tabHost.newTabSpec("scoretable").setIndicator("Score Table", res.getDrawable(R.drawable.icon64_64)).setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(0);
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    
}
